package com.waymap.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Component;

@Component
public class SendEmail {

    @Autowired
    private JavaMailSender mailSender;

    public void sendSimpleMail(String date) {
        try {
            String[] str = {"lebron.zhu@waymap.cn", "814820544@qq.com"};
            SimpleMailMessage message = new SimpleMailMessage();
            message.setFrom("443475872@qq.com");
            message.setTo(str);
            message.setSubject("WMS系统报错");
            message.setText("错误信息：" + date);
            mailSender.send(message);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
